﻿@using WebApp.ViewModels.Manage;
@model UserLoginModel
@{
    Layout = null;
}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>用户登录</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="" />
    <!-- google font -->
    <link rel="stylesheet" type="text/css" href="@Href("~/")Content/unicorn-b3/css/font-awesome-4.0.3.css" />
    <!-- styles -->

    <link rel="stylesheet" type="text/css" href="@Href("~/")Content/unicorn-b3/css/bootstrap.min-3.0.3.css" />
    <link rel="stylesheet" type="text/css" href="@Href("~/")Content/unicorn-b3/css/jquery.jscrollpane.css" />
    <link rel="stylesheet" type="text/css" href="@Href("~/")Content/unicorn-b3/css/unicorn-2.2.0.css" />

    <link rel="stylesheet" type="text/css" href="@Href("~/")Content/unicorn-rewrite.css" />
    <link rel="stylesheet" type="text/css" href="@Href("~/")Content/site.css" />
    <link rel="stylesheet" type="text/css" href="@Href("~/")Content/login.css" />
    <script type="text/javascript">
        try {
            top.moveTo(0, 0);
            top.resizeTo(screen.availWidth, screen.availHeight);
            if (top.location != self.location) {
                top.location.href = "/Member/Login";
            }
        }
        catch (e) { }
    </script>
</head>

<body style="background:#f9f9f9; margin:0;">
    <nav>
        <div class="nav" style="height:80px;">
            <div class="container" style="margin: 0;">
                <!-- Brand and toggle get grouped for better mobile display -->
                <div class="pull-left">
                    <a href="#/home"><img src="@Href("~/")content/images/login-logo.png" style="margin: 6px 20px;" /></a>
                </div>
                <div class="pull-left">
                    <h3 style="line-height:80px; font-size: 16px;">大型养路机械运用检修段</h3>
                </div>
            </div>
        </div>
    </nav>
    <div style="padding:110px 0;width:100%;">
        <div class="container" style="margin: 0 20px; width: auto;">
            <div class="row" style="">
                <div class="col-xs-7" style="color:white;text-align:center; vertical-align:middle;">
                    <img src="@Href("~/")content/images/login_banner.jpg" style="border-radius:100px; height:327px; max-width: 100%; vertical-align:middle;" />
                </div>
                <div class="col-xs-5">
                    <form id="sign-in" method="post">
                        <div class="form-login" style="padding-top:8px;padding-bottom:10px;">
                            <h3><b>欢迎使用管理人员年度测评管理系统</b></h3>
                            <hr style="margin: 10px 0;" />
                            <div class="row" style="margin-top:8px;">
                                <div class="col-xs-1"></div>
                                <label class="col-xs-10" for="userName" style="padding-right: 1px;text-align:left;line-height: 30px;">用户名</label>
                            </div>
                            <div class="row" style="margin-top:0px;">
                                <div class="col-xs-1"></div>
                                <div class="col-xs-10">
                                    @Html.TextBox("Username", "", new { @class = "form-control required", autocomplete = "off", style = "width:100%;height:30px;padding:2px 3px;background-color:#eff4f7;" })
                                </div>
                            </div>
                            <div class="row" style="margin-top:8px;">
                                <div class="col-xs-1"></div>
                                <label class="col-xs-10" for="userName" style="padding-right: 1px;text-align:left;line-height: 30px;">密码</label>
                            </div>
                            <div class="row">
                                <div class="col-xs-1"></div>
                                <div class="col-xs-10">
                                    @Html.Password("Password", "", new { @class = "form-control required", autocomplete = "off", style = "width:100%;height:30px;padding:2px 3px;background-color:#eff4f7;" })
                                </div>
                            </div>
                            @*@if (Model.Isneedcode == "1")
                                {
                                    <div class="row" style="margin-top:8px;">
                                        <div class="col-xs-1"></div>
                                        <label class="col-xs-10" for="userName" style="padding-right: 1px;text-align:left;line-height: 30px;">验证码</label>
                                    </div>
                                    <div class="row">
                                        <div class="col-xs-1"></div>
                                        <div class="col-xs-10">
                                            <div class="inner-addon right-addon">
                                                @Html.TextBox("ValidateCode", Model.ValidateCode, new { @class = "required", autocomplete = "off", style = "width:118px;height:26px;" })
                                                <i class="glyphicon iconfont icon-suo1" style="color:gray;" aria-hidden="true"></i>
                                            </div>
                                            <img src="/Member/GetValidateCode" id="imgCode" alt="单击可刷新" style="margin-top:-10px;margin-left:5px;cursor:pointer;" title="点击换一张" onclick="ClickRemoveChangeCode()" />
                                        </div>
                                    </div>
                                }*@
                            <div class="row" style="margin-top:10px;">
                                <div class="col-xs-1"></div>
                                <div class="col-xs-10">
                                    <span class="group-btn" style="text-align:center">
                                        <br>
                                        <input id="login" type="submit" class="btn btn-success" value="登录" style="width:100%;height:30px;" />
                                    </span>
                                </div>
                            </div>
                            @Html.HiddenFor(m => m.Isneedcode)
                            @Html.HiddenFor(m => m.Errornum)
                            @Html.HiddenFor(m => m.Clientid)
                            @if (Model.Errorlist != null && Model.Errorlist.Count > 0)
                            {
                                <div class="row" style="margin-top:10px;">
                                    <div class="col-xs-1"></div>
                                    <div class="col-xs-10">
                                        <div class="login_msg" id="errmsg">
                                            <label class="error" for="Username">
                                                @foreach (var errmsg in Model.Errorlist)
                                                {
                                                    @errmsg
                                                }
                                            </label>
                                        </div>
                                    </div>
                                </div>
                            }
                            else
                            {
                                <div class="row" style="margin-top:10px;">
                                    <div class="col-xs-1"></div>
                                    <div class="col-xs-10">
                                        <div class="login_msg" id="errmsg" style="display:none;"></div>
                                    </div>
                                </div>
                            }
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div id="footer" class="col-xs-12">
            <span style="color:#aaa;text-shadow:none;">建议使用Internet Explorer 9.0或以上版本浏览器，Windows XP请使用Chrome浏览器</span><br />
            <a href="@Href("~/")Content/download/chrome_xp.zip"><span style="color:#0072c4;text-shadow:none;">下载Chrome浏览器(XP)</span></a>
        </div>
    </div>


    <!-- javascript================================================== -->
    @Scripts.Render("~/bundles/jquery")
    <script type="text/javascript" src="@Href("~/")Scripts/jquery.ui.widget.js"></script>
    @*<script type="text/javascript" src="~/Content/jquery-easyui-1.4.1/jquery.min.js"></script>*@
    <script type="text/javascript" src="@Href("~/")Content/unicorn-b3/js/bootstrap.min-3.0.3.js"></script>

    <!--不支持jQuery 1.10以上版本，jQuery移除了$.browser方法-->
    @*<script type="text/javascript" src="~/Content/stilearn/js/uniform/jquery.uniform.js"></script>*@

    <!-- 这个是jquery.validate-1.10。
    <script type="text/javascript" src="~/Content/stilearn/js/validate/jquery.metadata.js"></script>
    <script type="text/javascript" src="~/Content/stilearn/js/validate/jquery.validate.js"></script>
    -->
    <script type="text/javascript" src="@Href("~/")Scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="@Href("~/")Scripts/jquery.validate.message-zh_CN.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            //debugger;
            $('#Username').focus();
            $('#ValidateCode').val("");

            $("#sign-in").validate({
                errorContainer: "#errmsg",
                errorLabelContainer: $("#errmsg"),
                messages: {
                    Username: {
                        required: '请输入用户名'
                    },
                    Password: {
                        required: '请输入密码'
                    },
                    ValidateCode: {
                        required: '请输入验证码',
                        remote: '验证码不正确'
                    }
                }
            });
            if ($("#ValidateCode").size()) {
                $("#ValidateCode").rules("add", {
                    required: true,
                    remote: {
                        url: '/Member/CheckValidateCode',
                        type: 'post',
                        data: {},
                        dataFilter: function (data, type) {
                            if (data == "yes")
                                return true;
                            else
                                return false;
                        }
                    }
                });
            }
        });
        function ClickRemoveChangeCode() {
            var code = $("#imgCode").attr("src");
            $("#imgCode").attr("src", "/Member/GetValidateCode?random=" + Math.random());
        }
    </script>
</body>
</html>
